package models;

import java.util.*;

import javax.persistence.*;

import play.db.jpa.*;

@Entity
public class Topic extends Model {
	String name;
	int status;
	@Lob
	String description;
	Date date;
	@ManyToOne
	EEntity entity;
	@OneToMany(mappedBy = "topic", cascade = CascadeType.ALL)
	List<Idea> ideas;
	@ManyToMany
	List<Tag> tags;
	@ManyToMany
	List<User> subscribers;
	@ManyToOne
	User creator;

	public Topic(String name, int status, String description, Date date,
			EEntity entity, User creator) {
		this.name = name;
		this.status = status;
		this.description = description;
		this.date = date;
		this.entity = entity;
		this.creator = creator;
		this.ideas = new ArrayList<Idea>();
		this.tags = new ArrayList<Tag>();
		this.subscribers = new ArrayList<User>();
	}
}
